home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 17 / develop 17 code / PwrPC Debugging / CrashOMatic / CrashOMatic.r < prev    next >
Encoding:
Text File  |  1993-12-01  |  4.2 KB  |  227 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Sample Application
  6. #
  7. #    CrashOMatic
  8. #
  9. #    CrashOMatic.r    -    Rez Source
  10. #
  11. #    Copyright © 1989-93 Apple Computer, Inc.
  12. ------------------------------------------------------------------------------*/
  13.  
  14.  
  15. #include "Types.r"
  16. #include "CodeFragmentTypes.r"
  17.  
  18. #include "CrashOMatic.h"
  19.  
  20.  
  21.  
  22. resource 'MBAR' (rMenuBar, preload) {
  23.     { mApple, mFile, mEdit, mTest };    /* four menus */
  24. };
  25.  
  26.  
  27. resource 'MENU' (mApple, preload) {
  28.     mApple, textMenuProc,
  29.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  30.     enabled, apple,
  31.     {
  32.         "About Crash-O-Matic…",
  33.             noicon, nokey, nomark, plain;
  34.         "-",
  35.             noicon, nokey, nomark, plain
  36.     }
  37. };
  38.  
  39. resource 'MENU' (mFile, preload) {
  40.     mFile, textMenuProc,
  41.     AllItems,                /* All items */
  42.     enabled, "File",
  43.     {
  44.         "Quit",
  45.             noicon, "Q", nomark, plain
  46.     }
  47. };
  48.  
  49. resource 'MENU' (mEdit, preload) {
  50.     mEdit, textMenuProc,
  51.     NoItems,                /* disable everything, program does the enabling */
  52.     enabled, "Edit",
  53.      {
  54.         "Undo",
  55.             noicon, "Z", nomark, plain;
  56.         "-",
  57.             noicon, nokey, nomark, plain;
  58.         "Cut",
  59.             noicon, "X", nomark, plain;
  60.         "Copy",
  61.             noicon, "C", nomark, plain;
  62.         "Paste",
  63.             noicon, "V", nomark, plain;
  64.         "Clear",
  65.             noicon, nokey, nomark, plain
  66.     }
  67. };
  68.  
  69. resource 'MENU' (mTest, preload) {
  70.     mTest, textMenuProc,
  71.     AllItems & ~MenuItem2 & ~MenuItem6,    /* figure it out for yourself */
  72.     enabled, "Debug",
  73.      {
  74.         "Go to Debugger",
  75.             noicon, nokey, nomark, plain;
  76.         "-",
  77.             noicon, nokey, nomark, plain;
  78.         "Clobber Location 0",
  79.             noicon, nokey, nomark, plain;
  80.         "Bus Error",
  81.             noicon, nokey, nomark, plain;
  82.         "Illegal Instruction",
  83.             noicon, nokey, nomark, plain;
  84.         "-",
  85.             noicon, nokey, nomark, plain;
  86.         "Exception Handlers Installed",
  87.             noicon, nokey, nomark, plain
  88.     }
  89. };
  90.  
  91.  
  92. /* this ALRT and DITL are used as an About screen */
  93.  
  94. resource 'ALRT' (rAboutAlert, purgeable) {
  95.     {40, 20, 160, 290},
  96.     rAboutAlert,
  97.     { /* array: 4 elements */
  98.         /* [1] */
  99.         OK, visible, silent,
  100.         /* [2] */
  101.         OK, visible, silent,
  102.         /* [3] */
  103.         OK, visible, silent,
  104.         /* [4] */
  105.         OK, visible, silent
  106.     }
  107. };
  108.  
  109. resource 'DITL' (rAboutAlert, purgeable) {
  110.     { /* array DITLarray: 5 elements */
  111.         /* [1] */
  112.         {88, 180, 108, 260},
  113.         Button {
  114.             enabled,
  115.             "OK"
  116.         },
  117.         /* [2] */
  118.         {8, 8, 24, 214},
  119.         StaticText {
  120.             disabled,
  121.             "Simple Sample (Crash-O-Matic)"
  122.         },
  123.         /* [3] */
  124.         {32, 8, 48, 237},
  125.         StaticText {
  126.             disabled,
  127.             "Copyright © 1993 Apple Computer"
  128.         },
  129.         /* [4] */
  130.         {56, 8, 72, 136},
  131.         StaticText {
  132.             disabled,
  133.             "Brought to you by:"
  134.         },
  135.         /* [5] */
  136.         {80, 24, 112, 167},
  137.         StaticText {
  138.             disabled,
  139.             "Brian Topping & \nDave Falkenburg"
  140.         }
  141.     }
  142. };
  143.  
  144.  
  145. /* this ALRT and DITL are used as an error screen */
  146.  
  147. resource 'ALRT' (rUserAlert, purgeable) {
  148.     {40, 20, 120, 260},
  149.     rUserAlert,
  150.     { /* array: 4 elements */
  151.         /* [1] */
  152.         OK, visible, silent,
  153.         /* [2] */
  154.         OK, visible, silent,
  155.         /* [3] */
  156.         OK, visible, silent,
  157.         /* [4] */
  158.         OK, visible, silent
  159.     }
  160. };
  161.  
  162.  
  163. resource 'DITL' (rUserAlert, purgeable) {
  164.     { /* array DITLarray: 3 elements */
  165.         /* [1] */
  166.         {50, 150, 70, 230},
  167.         Button {
  168.             enabled,
  169.             "OK"
  170.         },
  171.         /* [2] */
  172.         {10, 60, 30, 230},
  173.         StaticText {
  174.             disabled,
  175.             "^0"
  176.         },
  177.         /* [3] */
  178.         {8, 8, 40, 40},
  179.         Icon {
  180.             disabled,
  181.             2
  182.         }
  183.     }
  184. };
  185.  
  186.  
  187.  
  188. resource 'SIZE' (-1) {
  189.     dontSaveScreen,
  190.     acceptSuspendResumeEvents,
  191.     enableOptionSwitch,
  192.     canBackground,                /* we can background; we don't currently, but our sleep value */
  193.                                 /* guarantees we don't hog the Mac while we are in the background */
  194.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  195.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  196.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  197.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  198.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  199.     reserved,
  200.     reserved,
  201.     reserved,
  202.     reserved,
  203.     reserved,
  204.     reserved,
  205.     reserved,
  206.     kPrefSize * 1024,
  207.     kMinSize * 1024    
  208. };
  209.  
  210. resource 'cfrg' (0) {
  211.     {    /* array memberArray: 1 elements */
  212.         /* [1] */
  213.         kPowerPC,
  214.         kFullLib,
  215.         kNoVersionNum,
  216.         kNoVersionNum,
  217.         65536,
  218.         appSubFolderID,
  219.         kIsApp,
  220.         kOnDiskFlat,
  221.         kZeroOffset,
  222.         kWholeFork,
  223.         "CrashOMatic"
  224.     }
  225. };
  226.  
  227.